package leetcode.medium.powerfulintegers;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import junit.framework.Assert;
import util.AssertUtils;
import util.SolutionValidator;

import java.util.Arrays;
import java.util.List;

/**
 * <h4>
 *     <a href="https://leetcode.cn/problems/time-needed-to-inform-all-employees/">
 *         1376. Time Needed to Inform All Employees [Medium]
 *     </a>
 * </h4>
 * <h4>How to solve this question?</h4>
 * <p>
 *     It's a multi-way tree with weight on its nodes. The task is to find a path from the root to one of its leaf
 *     nodes in which the corresponding cumulative path sum is the greatest among all possible paths.<br/>
 *     Use dfs to solve this question.
 * </p>
 */
public class SolutionTest {
    private static Solution solution;

    @BeforeClass
    public static void setup() {
        SolutionValidator.checkSolved(Solution.class);
        solution = new Solution();
    }

    @AfterClass
    public static void tearUp() {
        solution = null;
    }

    @Test
    public void test1() {
        int x = 2, y = 3, bound = 10;
        List<Integer> res = solution.powerfulIntegers(x, y, bound);
        Assert.assertNotNull(null);
        AssertUtils.assertListEquals(Arrays.asList(2,3,4,5,7,9,10), res);
    }
}
